<template>
    <div class="login">
        <form id="formBox" autocomplete="on">
          <div class="input-wrap">
              <label for="userName">用户名:</label>
              <input type="text" id="userName" placeholder="请输入用户民" v-model="loginInfo.userName" />
          </div>
          <div class="input-wrap">
              <label for="password">密码:</label>
              <input type="text" id="password" placeholder="请输入密码" v-model="loginInfo.password" />
          </div>
          <button type="button" @click="toRegister">注册</button>
        </form>
      </div>
  </template>
  
  <script setup>
  import userLogin from "../hooks/useLogin";

    const {loginInfo,justifyEmpty,register} = userLogin();
    function toRegister(){
        let isValid = justifyEmpty(loginInfo);
        if(isValid){
          register(loginInfo)
        }
    }
  </script>
  
  <style lang="less" scoped>
      
  </style>
  